<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{ .Title }}</title>
    {{ partial "ifex_partial" (slice "base-head" .) }}
    <link rel="stylesheet" href="/res/libs/fontawesome/css/all.min.css"></link>
    <link rel="stylesheet" href="/res/libs/chota/css/chota.min.css"></link>

    <link rel="stylesheet" href="{{
      (
        resources.Get (printf "res/style/site/%s.scss" .Site.Params.SiteTheme) |
        resources.ToCSS (dict
          "transpiler" "dartsass"
          "outputStyle" "compressed"
          "targetPath" (printf "res/style/site-%s.min.css" .Site.Params.SiteTheme)
        ) |
        resources.Fingerprint
      ).RelPermalink
    }}"></link>
    <script type="text/javascript" src="{{
      (
        resources.Get "res/script/site.js" |
        js.Build (dict
          "targetPath" "res/script/site.min.js"
          "minify" true
        ) |
        resources.Fingerprint
      ).RelPermalink
    }}"></script>

    <link id="markdown-body-style" rel="stylesheet" href="{{
      (
        resources.Get (printf "res/style/markdown-body/%s.scss" .Site.Params.SiteTheme) |
        resources.ToCSS (dict
          "transpiler" "dartsass"
          "outputStyle" "compressed"
          "targetPath" (printf "res/style/markdown-body-%s.min.css" .Site.Params.SiteTheme)
        ) |
        resources.Fingerprint
      ).RelPermalink
    }}"></link>
    <script type="text/javascript" src="{{
      (
        resources.Get "res/script/markdown-body.js" |
        js.Build (dict
          "targetPath" "res/script/markdown-body.min.js"
          "minify" true
        ) |
        resources.Fingerprint
      ).RelPermalink
    }}"></script>

    {{ .Site.Params.ExtraHeaderHTML | safeHTML }}

  </head>

  <body>
    <!-- 头部 -->
    <div id="header">
      <!-- 导航条 -->
      <nav id="navbar" class="row">
        <div class="is-left col-12 col-3-md row">
          <a id="navbar-brand" class="brand" href="/">{{ .Site.Title }}</a>
          <label id="navbar-toggle-menu" for="navbar-toggle-menu-state" class="hide-md hide-lg">
            <span></span>
            <span></span>
            <span></span>
          </label>
        </div>
        <input id="navbar-toggle-menu-state" type="checkbox" style="display:none"></input>
        <div id="navbar-menu" class="is-right col-12 col-9-md row hide-xs-noimportant hide-sm-noimportant">
          {{ range .Site.Sections }}
          <a href="/{{ .Section | urlize }}">{{ .Section | humanize | title }}</a>
          {{ end }}
          {{ range $taxonomyname, $taxonomy := .Site.Taxonomies }}
          <a href="/{{ $taxonomyname | urlize }}">{{ $taxonomyname | humanize | title }}</a>
          {{ end }}
          {{ range .Site.Menus.main }}
          <a href="{{ .URL }}">{{ .Pre }}{{ .Name | humanize | title }}</a>
          {{ end }}
          <a href="javascript:void(0)" id="navbar-toggle-mode" onclick="return toggleColorMode()"></a>
        </div>
      </nav>
    </div>

    <!-- 主体 -->
    <div id="main" class="row">
      <div id="main-left" class="hide-xs hide-sm col-2-md col-3-lg">
        {{ block "mainLeft" . }}{{ end}}
      </div>
      <div id="main-center" class="col-12 col-8-md col-6-lg mdb">
        <div id="main-title" class="text-center">
          {{ block "mainTitle" . }}{{ end }}
        </div>
        <div id="main-body">
          {{ block "mainBody" . }}{{ end }}
        </div>
      </div>
      <div id="main-right" class="hide-xs hide-sm col-2-md col-3-lg">
        {{ block "mainRight" . }}{{ end }}
      </div>
    </div>

    <!-- 页脚 -->
    <div id="footer" class="text-center">
      <p>
        Powered By <a href="https://gohugo.io/">Hugo</a>/<a href="https://jenil.github.io/chota">Chota</a>,
        Generated Using <a href="https://github.com/huangjunwen/mdtool">MDTool</a>
      </p>
      <p>&copy; {{ now.Format "2006"}}. All rights reserved</p>
    </div>

    {{ block "bodyEnd" . }}{{ end }}
  </body>
</html>
